/* 主聊天区域组件样式 */

/* 主要内容区域 */
.app-main-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  gap: 20px;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
}

/* 消息区域 */
.messages-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.message-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: rgba(240, 248, 255, 0.95);
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(25, 118, 210, 0.15);
  margin-bottom: 20px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(144, 202, 249, 0.3);
}

/* 输入区域 */
.input-section {
  flex-shrink: 0;
}

.input-container {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: rgba(240, 248, 255, 0.95);
  padding: 15px;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(25, 118, 210, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: slideInFromRight 0.5s ease-out;
}

/* 消息输入框 */
.message-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(25, 118, 210, 0.3);
  border-radius: 25px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.8);
  color: #333;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  resize: vertical;
  min-height: 20px;
  max-height: 150px;
  outline: none;
}

.message-input:focus,
#message-input:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.message-input::placeholder,
#message-input::placeholder {
  color: rgba(25, 118, 210, 0.6);
}

/* 消息样式 */
.message {
  margin-bottom: 15px;
  animation: fadeIn 0.5s ease-out;
}

.user-message {
  background: linear-gradient(135deg, #1976d2 0%, #1e88e5 100%);
  color: white;
  padding: 12px 18px;
  border-radius: 18px 18px 4px 18px;
  margin-left: 20%;
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
  backdrop-filter: blur(10px);
  animation: slideInFromRight 0.4s ease-out;
}

.ai-message {
  background: linear-gradient(135deg, #f0f8ff 0%, #e3f2fd 100%);
  color: #1565c0;
  padding: 12px 18px;
  border-radius: 18px 18px 18px 4px;
  margin-right: 20%;
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.1);
  border: 1px solid rgba(25, 118, 210, 0.2);
  backdrop-filter: blur(10px);
  animation: slideInFromLeft 0.4s ease-out;
}

.thinking-message {
  font-style: italic;
  color: #1565c0;
  background: linear-gradient(135deg, #e8f4fd 0%, #f3f9ff 100%);
  border: 1px solid rgba(25, 118, 210, 0.15);
}

.thinking-content {
  font-family: monospace;
  color: #1976d2;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-x: auto;
  background: linear-gradient(135deg, #f0f8ff 0%, #e3f2fd 100%);
  border-left: 3px solid #42a5f5;
  padding: 10px;
  margin-top: 8px;
  border-radius: 2px;
}

.thinking-content span {
  animation: thinking-fade 0.5s ease-in;
}

/* 发送按钮 */
.send-btn,
#send-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
  backdrop-filter: blur(5px);
}

.send-btn:hover,
#send-btn:hover {
  background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(25, 118, 210, 0.4);
}

.send-btn:active,
#send-btn:active {
  transform: translateY(0);
}

/* 状态区域 */
.status-section {
  flex-shrink: 0;
}

/* 模型信息样式 */
.model-info {
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(25, 118, 210, 0.2);
  padding: 8px 16px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  animation: pulse 2s infinite;
}

/* 状态指示器变体 */
.status-online {
  background: #4caf50;
}

.status-offline {
  background: #f44336;
}

.status-connecting {
  background: #ff9800;
}

/* Markdown 样式 */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  margin-top: 10px;
  margin-bottom: 10px;
  color: #1565c0;
}

.markdown-content code {
  background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
  color: #1976d2;
  padding: 2px 4px;
  border-radius: 3px;
  border: 1px solid rgba(25, 118, 210, 0.2);
}

.markdown-content pre {
  background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
  border: 1px solid rgba(25, 118, 210, 0.2);
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
}

.markdown-content blockquote {
  border-left: 3px solid #42a5f5;
  padding-left: 10px;
  color: #1976d2;
}

.markdown-content ul,
.markdown-content ol {
  padding-left: 20px;
}

/* 正在输入指示器样式 */
.typing-indicator {
  display: flex;
  padding: 5px;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  margin: 0 2px;
  background-color: #1976d2;
  border-radius: 50%;
  display: inline-block;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

/* 禁用状态样式 */
#message-input:disabled, 
#send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(50%);
}

/* 动画定义 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

@keyframes typing-bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

@keyframes thinking-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 通知样式 */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 400px;
  backdrop-filter: blur(10px);
  animation: notificationSlideIn 0.3s ease-out;
}

.notification-success {
  background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
  color: #155724;
  border: 1px solid #c3e6cb;
}

.notification-error {
  background: linear-gradient(135deg, #fdeaea 0%, #f8d7da 100%);
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.notification-warning {
  background: linear-gradient(135deg, #fffbf0 0%, #fff3cd 100%);
  color: #856404;
  border: 1px solid #ffeaa7;
}

.notification-info {
  background: linear-gradient(135deg, #e3f2fd 0%, #d1ecf1 100%);
  color: #1565c0;
  border: 1px solid #90caf9;
}

.notification-icon {
  font-size: 16px;
}

.notification-message {
  flex: 1;
}

.notification-close {
  background: none;
  border: none;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-close:hover {
  opacity: 1;
}

.notification-hide {
  animation: notificationSlideOut 0.3s ease-in forwards;
}

@keyframes notificationSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes notificationSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* 主题适配 */

/* 默认主题（蓝色） */
body .app-main,
body[data-theme="blue"] .app-main {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #90caf9 100%);
}

/* 黑色主题 */
body[data-theme="dark"] .app-main {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #404040 100%);
}

body[data-theme="dark"] .message-container {
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .input-container {
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] #message-input {
  background: rgba(50, 50, 50, 0.8);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

body[data-theme="dark"] #message-input:focus {
  background: rgba(60, 60, 60, 0.95);
  border-color: #666;
}

body[data-theme="dark"] #message-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

body[data-theme="dark"] #send-btn {
  background: linear-gradient(135deg, #404040 0%, #505050 50%, #606060 100%);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

body[data-theme="dark"] #send-btn:hover {
  background: linear-gradient(135deg, #505050 0%, #606060 50%, #707070 100%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

body[data-theme="dark"] .user-message {
  background: linear-gradient(135deg, #404040 0%, #505050 50%, #606060 100%);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .ai-message {
  background: linear-gradient(135deg, #2a2a2a 0%, #353535 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body[data-theme="dark"] .model-info {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 白色主题 */
body[data-theme="light"] .app-main {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%);
}

body[data-theme="light"] .message-container {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .input-container {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] #message-input {
  background: rgba(248, 249, 250, 0.8);
  color: #333;
  border-color: rgba(0, 0, 0, 0.2);
}

body[data-theme="light"] #message-input:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: #666;
}

body[data-theme="light"] #message-input::placeholder {
  color: rgba(0, 0, 0, 0.6);
}

body[data-theme="light"] #send-btn {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%);
  color: #333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body[data-theme="light"] #send-btn:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 50%, #ced4da 100%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

body[data-theme="light"] .user-message {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%);
  color: #333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body[data-theme="light"] .ai-message {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  color: #333;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .model-info {
  background: rgba(255, 255, 255, 0.3);
  color: #333;
  border: 1px solid rgba(0, 0, 0, 0.2);
}
